'''
Created on Sep 9, 2010

@author: mal
'''
#import NumericalArchives as output
class archivedLink(object):
    '''
    classdocs
    '''


    def __init__(self):
        self.base_url = ""
        self.mementos = []
        self.memento_dates =[]
        self.current= 0
        
        
    def add_memento_url(self,url):
        self.mementos.append([url,""])
        archivedLink.total_mementos+=1
        
    def add_memento_date(self,date):
        if(len(self.mementos)>self.current):
            self.mementos[self.current][1] = date    
            self.current+=1
        
 #   def format(self):
 #       output.numericalArchive.outputfile.write("<LINK>\n")
 #       output.numericalArchive.outputfile.write(self.base_url + " This Link has: "  + str(len(self.mementos)) +" Mementos\n")
 #       for memento in self.mementos:
 #           output.numericalArchive.outputfile.write("URL: " + memento[0] + " Date: " + memento[1] + "\n")
   
    def check_mementos(self):
        for memento in self.mementos:
	 if(memento[0] != "" and memento[1] != ""):
	  return true
	return false

    def printToScreen(self):
        print("<LINK>\n")
        print(self.base_url + " This Link has: "  + str(len(self.mementos)) +" Mementos\n")
        for memento in self.mementos:
            print("URL: " + memento[0] + " Date: " + memento[1] + "\n")
            
            
            
archivedLink.total_mementos = 0            
